<tpl> include file='sys_config.head.html' </tpl>
<div id="doc3">
	<div id="yui-main">
		<div class="yui-g">
 			<div id="divinbox">
				<div class="gtlbar">
					<div class="gtlbar-left">员工管理 &gt;&gt; 修改员工</div>
				</div>
				<div class="ctge">
					<div class="ctge-1">
						<form id="form1" action="member.manage.php" method="post" enctype="multipart/form_data">
						<input type="hidden" id="action" name="action" value="update_member" />
						<input type="hidden" name="sys_member_id" value="<tpl> $member_array.sys_member_id </tpl>" />
						<div class="ctge-1-1">
							<table cellSpacing="0" cellPadding="0" class="fct" border="0">
								<tr>
								    <td colspan="2">基本信息</td>
								</tr>
							     <!--<tr>
							         <th>部门</th>
							         <td>
							             <select name="department">
							                 <option value="">选择部门</option>
							                 <tpl>section name=loop loop=$department_list</tpl>
							                 	<option value="<tpl>$department_list[loop].id</tpl>" <tpl>if $member_array.department_id eq $department_list[loop].id</tpl>selected<tpl>/if</tpl>><tpl>$department_list[loop].name</tpl></option>
							                 <tpl>/section</tpl>
							             </select>
							             <span><input type="button" name="department" value="管理部门"></span>
							         </td>
							         
							     </tr>-->
							    <tr>
							         <th>所属部门</th>
							         <td>
							             <select name="department" id="department">
							             <tpl> section name=loop loop=$department_list </tpl>
							             	<option value="<tpl> $department_list[loop].id </tpl>" <tpl> if $department_list[loop].id ==  $member_array.department_id </tpl> selected <tpl> /if </tpl> ><tpl> $department_list[loop].name </tpl></option>
							             <tpl> /section </tpl>
							             </select>
							         </td>
							    </tr>
								<tr>
									<th>用户名:</th>
									<td>
									<tpl>$member_array.sys_login_name</tpl></td>
								</tr>
								<tr>
									<th>员工姓名:</th>
									<td>
									<input type="text" value="<tpl>$member_array.real_name</tpl>" name="real_name"></td>
								</tr>
								<tr>
									<th>密码:</th>
									<td>
									<span class="dptn">密码5-16位 </span>
									<input class="fct-input" name="sys_password" id="sys_password" type="text" maxlength="16" value=""/></td>
								</tr>
								<tr>
									<th>再次输入密码:</th>
									<td>
										<input class="fct-input" name="sys_password_two" id="sys_password_two" type="text" maxlength="16" />
									</td>
								</tr>
								<tr>
								    <th>照片：</th>
								    <td>
								       <tpl> if $member_array.pic neq '' </tpl>
										<img width="100px;" height="100px;" src="<tpl> $site_url </tpl>/<tpl> $member_array.pic </tpl>" border="0" />
										<input type="hidden" name="pic" id="pic" value="<tpl> $member_array.pic </tpl>" />
										<a id="del_pic" name="del_pic" href="javascript:;">删除</a>
									<tpl> else </tpl>
										<input type="file" name="pic" />
									<tpl> /if </tpl>
								    </td>
								</tr>
								<tr>
								    <th>性别：</th>
								    <td>
								        <input type="radio" name="gender" value="1" <tpl> if $member_array.gender eq 1 </tpl> checked <tpl>/if</tpl> >男
								        <input type="radio" name="gender" value="0" <tpl> if $member_array.gender eq 0 </tpl> checked <tpl>/if</tpl> >女
								    </td>
								</tr>
								<tr>
								    <th>出生年月：</th>
								    <td>
								        <input value="<tpl>$member_array.birthday|date_format:'%Y-%m-%d'</tpl>" class="fct-input" readonly="true" name="txtBirthday" id="txtBirthday" type="text" />
								    </td>
								</tr>
								<tr>
									<th>Email:</th>
									<td>
									<input value="<tpl>$member_array.sys_email</tpl>" class="fct-input" name="sys_email" id="sys_email" type="text" maxlength="100" /></td>
								</tr>
								
								<tr>
									<th>角色:</th>
									<td>
										<select name="sys_group_id">
										<tpl> section name=loop loop=$sys_group_list </tpl>
											<option 
											<tpl> if $sys_group_list[loop].sys_group_id eq $member_array.sys_group_id </tpl>
											 selected="selected"
											<tpl> /if </tpl>
											value="<tpl> $sys_group_list[loop].sys_group_id </tpl>"><tpl> $sys_group_list[loop].sys_group_name </tpl></option>
										<tpl> /section </tpl>
										</select>
									</td>
								</tr>
								<tr>
								    <td colspan="2">扩展信息</td>
								</tr>
								<tr>
									<th>工资:</th>
									<td><input class="fct-input" name="gongzi" id="gongzi" type="text" value="<tpl> $member_array.gongzi </tpl>" maxlength="10" /></td>
								</tr>
								<tr>
									<th>入职时间:</th>
									<td><input class="fct-input" readonly="true" name="in_time" id="in_time" type="text" value="<tpl>$member_array.in_time|date_format:'%Y-%m-%d'</tpl>" /></td>
	                            </tr>
	                            <tr>
	                                <th>离职时间</th>
	                                <td><input class="fct-input" readonly="true" name="out_time" id="out_time" type="text" value="<tpl>$member_array.out_time|date_format:'%Y-%m-%d'</tpl>" /></td>
	                            </tr>
							</table>
						</div>
						<div class="bth-ct">
						<div class="bth-pl">
							<input class="bthl" value="保存" type="submit" />
							<input type="button" class="bthl" value="返回" onclick='history.back();'/>
						</div>
					</div>
					</form>
					</div>
				</div>	
			</div>
		</div>
	</div>
</div>
<tpl> include file='sys_config.js.html' </tpl>
<link href="<tpl> $site_url </tpl>/js/jquery/ui.theme.css" rel="stylesheet" type="text/css" />
<script src="<tpl> $site_url </tpl>/js/jquery/ui.datepicker.js"></script>
<script src="<tpl> $site_url </tpl>/js/jquery/jquery.blockUI.js"></script>
<script>
$(document).ready(function(){
	$('#txtBirthday').datepicker({
    		dateFormat:'yy-mm-dd',
    		changeMonth: true,
    		changeYear: true
    });
    $('#in_time').datepicker({
		dateFormat:'yy-mm-dd',
		changeMonth: true,
		changeYear: true
	});
    $('#out_time').datepicker({
    	dateFormat:'yy-mm-dd',
    	changeMonth: true,
    	changeYear: true
    });
	$('#del_pic').click(function(){
		$('input[@id=action]').val('del_pic');
		document.getElementById('form1').submit();
	});
});
$("#form_add").validate({
	errorClass: "wrong",
	rules: {
		sys_password: {required:true,minlength:5,maxlength:16},
		sys_password_two: {required:true,minlength:5,maxlength:16,equalTo:'#sys_password'},
		sys_email: {required:true,email:true}
	},
	messages: {
		sys_password: {required: "请填写密码",minlength:"密码至少5个字符",maxlength:"密码不能超过16个字符"},
		sys_password_two: {required: "请确认密码",minlength:"密码至少5个字符",maxlength:"密码不能超过16个字符",equalTo:"俩次密码输入不同"},
		sys_email: {required:"email地址不能为空",email:"email格式错误"}
	}
});
</script>
</body>
</html>
